<template>
  <div class="werapp">
    <div class="heard">
      <van-nav-bar
        title="讲师详情"
        left-arrow
        @click-left="$router.push('/index')"
      >
      </van-nav-bar>
      <Loading v-if="list==''"/>
      <div v-else>
        <div class="box">
          <img :src="list.teacher.avatar" alt="" />
          <span>女 年教龄</span>
          <div class="box-text">取消关注</div>
        </div>
        <van-tabs>
          <van-tab title="讲师介绍"></van-tab>
          <van-tab title="主讲课程"></van-tab>
          <van-tab title="学员评价">
            <van-empty image="error" description="暂无数据" />
          </van-tab>
        </van-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import { teacher } from "../../request/http";
import Loading from "../commponts/loading.vue";
export default {
  components: {
    Loading,
},
  data() {
    return {
      list: [],
    };
  },
  created() {
    console.log(this.$route.query.id);
    teacher(this.$route.query.id).then((res) => {
      console.log(res);
      this.list = res.data;
    });
  },
};
</script>

<style lang="scss" scoped>
.werapp {
  background: rgb(242, 243, 245);
}
.van-nav-bar {
  height: 2.667rem;
  background: #5ba2f4;
  color: white !important;
}
.box {
  height: 2.667rem;
  width: 95%;
  margin: 0 auto;
  position: relative;
  top: -100px;
  z-index: 999;
  background: #fff;
  border-radius: 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  img {
    width: 1.333rem;
    height: 1.333rem;
    margin: 0 0.267rem;
    border-radius: 100%;
  }
  span {
    flex: 1;
  }
  .box-text {
    width: 1.653rem;
    height: 0.747rem;
    margin-right: 50px;
    background: #ebeefe;
    border-radius: 0.4rem;
    text-align: center;
    line-height: 0.747rem;
    color: #eb6100;
  }
}
</style>